package environment;

import java.awt.Point;
import java.awt.Polygon;
import java.awt.Shape;
import java.awt.geom.Area;

public class Environment2 extends AbstractEnvironment{

	public Environment2(Polygon outer){
		Polygon ar = outer;
		area = new Area(ar);
//		Rectangle wall = new Rectangle(27, 65 , 45, 66); // create an obstacle
//		Area w = new Area(wall);
//		obstacles.add(w);
//		Rectangle wall2 = new Rectangle(20, 70 , 70, 10);
//		Area w2 = new Area(wall2);
//		obstacles.add(w2);
//		for (int i = 0; i < obstacles.size(); i++) {
//			area.subtract(obstacles.get(i));
//		}
	}
        public void addObstacle(Shape wall){
           Area w = new Area(wall);
           obstacles.add(w);
        }
        
        public Area getFinalArea(){
            for (int i = 0; i < obstacles.size(); i++) { 
			area.subtract(obstacles.get(i));
            }
            return getArea();
        }
}
